# -*- coding: utf-8 -*-
"""
Module Description:
Date: 2018/3/26
Author: FQ
"""

from pyshare.bll.mixins.activity import RankActivityMixin
from pyshare.const.enums.activity import ActivityStatus
from pyshare.utils.time_utils import getCT


class CrossRankActivityMixin(RankActivityMixin):
    show_time = NotImplemented

    @property
    def is_show(self):
        return self.status == ActivityStatus.Open and (self.show_time <= getCT() < self.award_end_time)

    @property
    def is_in_prepare(self):
        return self.show_time <= getCT() < self.start_time

    @property
    def is_in_start_award_end(self):
        return self.status == ActivityStatus.Open and (self.start_time <= getCT() < self.award_end_time)